import app
import requests

class UserApi(object):

    def __init__(self):
        self.token_url = app.URL + "/api/v1/token/user"
        self.verify_url = app.URL + "/api/v1/token/verify"
        self.address_url = app.URL + "/api/v1/address"
    def get_token(self,code):
        data={"code":code}
        return  requests.post(self.token_url,headers=app.header
                              ,json=data)

    def verify_token(self,token):
        data = {"token":token}
        return requests.post(self.verify_url,headers=app.header
                             ,json=data)

    def get_address(self):
        return  requests.get(self.address_url,headers=app.header)